import request from "../request";

// 查询公式库
export function queryByPage(data) {
  return request({
    url: "/manage/list",
    method: "get",
    params: data
  });
}
//删除公式库
export function removeFormula(data) {
  return request({
    // url: `/system/user?uniqueId=${data}`,
    url: "/manage/remove",
    method: "post",
    data: data
  });
}

//评估模型 类型列表
export function queryTypeList(data) {
  return request({
    url: "/type/list",
    method: "get",
    params: data
  });
}

//评估模型 获取评估模型列表
export function getDeviceList(data) {
  return request({
    url: "/relation/getInfobydeviceId",
    method: "get",
    params: data
  });
}
//评估模型 获取评估模型列表
export function getInfoPerson(data) {
  return request({
    url: "/relation/getInfoPerson",
    method: "get",
    params: data
  });
}



// 评估规则（保存）
export function saveInsert(data) {
  return request({
    url: "/typeconfig/insert",
    method: "post",
    data: data
  });
}



//评估规则 通过id获取基本信息
export function getDeviceId(data) {
  return request({
    url: "/nari/station/getById/" + data,
    method: "get",
    // params: data
  });
}

//新增规则

export function addRule(data) {
  return request({
    url: "/rule/add",
    method: "post",
    data: data
  });
}

//公式库管理新增公式

export function getAdd(data) {
  return request({
    url: "/manage/addInfo",
    method: "post",
    data: data
  });
}

//健康度评估首页开始评估
export function healthyEvaluation(data) {
  return request({
    url: "/healthy/assessment",
    method: "post",
    data: data
  });
}

//健康度评估首页查询列表
export function healthyQuery(data) {
  return request({
    url: "/history/listByTime",
    method: "get",
    params: data
  });
}

//健康度评估首页评估详情
export function historyRecord(data) {
  return request({
    url: "/historyDetails/list",
    method: "post",
    data: data
  });
}

//健康度评估首页评估详情影响因素种类占比饼图
export function historyGetchart(data) {
  return request({
    url: "/historyDetails/getChart",
    method: "post",
    data: data
  });
}

// 规则查询
export function getRuleQuery(data) {
  return request({
    url: "/rule/getlist",
    method: "get",
    params: data
  });
}
//评估模型绑定规则
export function postRules(data) {
  return request({
    url: "/relation/add",
    method: "post",
    data: data
  });
}
// 评估规则绑定
export function ruledetails(data) {
  return request({
    url: "/ruledetails/add",
    method: "post",
    data: data
  });
}
//公式库管理详情
export function getManageinfo(data) {
  return request({
    url: "/manage/manageinfo",
    method: "get",
    params: data
  });
}
